package lanqiaotrain.t2;

import java.util.Scanner;

/**
 * @Author: Hasee
 * @Date: 2020-10-04 11:04:15
 */
public class Basic10 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k;
        String i="";
        if (n==0){
            System.out.println("0");
        }else {
            while (n>0){
                k=n%16;
                n=n/16;
                switch (k){
                    case 0:
                        i="0"+i;
                        continue;
                    case 1:
                        i="1"+i;
                        continue;
                    case 2:
                        i="2"+i;
                        continue;
                    case 3:
                        i="3"+i;
                        continue;
                    case 4:
                        i="4"+i;
                        continue;
                    case 5:
                        i="5"+i;
                        continue;
                    case 6:
                        i="6"+i;
                        continue;
                    case 7:
                        i="7"+i;
                        continue;
                    case 8:
                        i="8"+i;
                        continue;
                    case 9:
                        i="9"+i;
                        continue;
                    case 10:
                        i="A"+i;
                        continue;
                    case 11:
                        i="B"+i;
                        continue;
                    case 12:
                        i="C"+i;
                        continue;
                    case 13:
                        i="D"+i;
                        continue;
                    case 14:
                        i="E"+i;
                        continue;
                    case 15:
                        i="F"+i;
                        continue;
                }
            }
            System.out.println(i);
        }

    }
}
